import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import store from './store'
import 'element-ui/lib/theme-chalk/index.css'
import '@/common/css/element-reset.scss'
import '@/common/css/package/index.scss';
import filters from '@/plugins/filters/index';
import directives from '@/plugins/directives/index';
import { done } from 'nprogress'
import lodash from 'lodash'

Vue.use(ElementUI) // 注册element-ui
Vue.prototype.lodash = lodash
import '../../lib/lib'; // 公用库
import routerFilter from '@/lib/routerFilter.js'
Vue.use(directives)
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  ak: 'aoXzuTCFGbRkUveAbzmfGS3PVLLTFFNR'
})

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});

router.beforeEach((to, from, next) => {
  routerFilter(to, from, next)
})

router.afterEach(() => {
  done()
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
